#version 450 core

layout(location = 0) in vec3 positionOS;
layout(location = 2) in vec2 uv;

layout(std140, binding = 0) uniform PerDraw
{
    mat4 viewMatrix;
    mat4 projMatrix;
    vec3 cameraPos;
} perDraw;

layout(std140, binding = 1) uniform PerObject
{
    mat4 modelMatrix[2];
} perObject;

out Varyings
{
    vec2 uv;
} o;

void main()
{
    gl_Position = perDraw.projMatrix * perDraw.viewMatrix * perObject.modelMatrix[gl_InstanceID] * vec4(positionOS, 1.0);
    o.uv = uv;
}
